﻿using LanguagePolish.EntityModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LanguagePolish.Controls.Meta
{
    public class ClassLessonsProvider : ILessonsProvider
    {
        private Class myClass;

        public ClassLessonsProvider(Class myClass)
        {
            if (myClass == null)
                throw new ArgumentNullException("myClass");
            this.myClass = myClass;
        }

        public IEnumerable<Lesson> GetLessons(DateTime from, DateTime to)
        {
            var res = myClass.Lessons.Where(l => l.LessonDate >= from && l.LessonDate <= to).ToList();
            return res;
        }
    }
}
